Skip to content

fix(donate): Set .edu membership payment status to succeeded#7211

Merged
albertisfu merged 3 commits intomainfrom
fix-edu-membership-payment-status
Apr 10, 2026
Merged

fix(donate): Set .edu membership payment status to succeeded#7211
albertisfu merged 3 commits intomainfrom
fix-edu-membership-payment-status

Conversation

@ERosendo
Copy link
Copy Markdown
Contributor

Summary

.edu membership webhooks from Neon CRM don't include a payments array in their payload. Our code in _get_membership_data returns an empty string when no payments are present, and _map_payment_status_value maps that to PENDING via its default case. Since .edu memberships are free, no subsequent payment webhook ever arrives to correct this, leaving these records permanently stuck as "Awaiting payment."

This PR updates _handle_membership_creation to check if the membership is EDU-level and the webhook had no payment info. When both are true, payment_status is set to SUCCEEDED instead of falling through to the default PENDING.

Existing affected records will be corrected via a script in production after this is merged.

Deployment

This PR should:

  • skip-deploy (skips everything below)
    • skip-web-deploy
    • skip-celery-deploy
    • skip-cronjob-deploy
    • skip-daemon-deploy

.edu membership webhooks from Neon don't include a payments array, causing the payment_status to default to PENDING. Since .edu memberships are free, treat missing payment info as SUCCEEDED.
@ERosendo ERosendo marked this pull request as ready for review April 10, 2026 15:12
@ERosendo ERosendo requested a review from albertisfu April 10, 2026 15:13
@ERosendo ERosendo moved this to To Do in Sprint (Web Team) Apr 10, 2026
@albertisfu albertisfu moved this from To Do to In progress in Sprint (Web Team) Apr 10, 2026
Copy link
Copy Markdown
Contributor

@albertisfu albertisfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ERosendo this looks good. Just the suggestion we talked about.

membership_level == NeonMembershipLevel.EDU
and not membership_data["paymentStatus"]
):
payment_status = MembershipPaymentStatus.SUCCEEDED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case Neon’s logic changes in the future and it starts sending payment info with a failed status, It seems like a good idea to log an error so we can review the membership manually and update the logic accordingly.

@albertisfu albertisfu moved this from In progress to To Do in Sprint (Web Team) Apr 10, 2026
@albertisfu albertisfu assigned ERosendo and unassigned albertisfu Apr 10, 2026
@ERosendo ERosendo requested a review from albertisfu April 10, 2026 17:52
@ERosendo ERosendo assigned albertisfu and unassigned ERosendo Apr 10, 2026
Copy link
Copy Markdown
Contributor

@albertisfu albertisfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you.

@albertisfu albertisfu merged commit b278bfc into main Apr 10, 2026
8 checks passed
@albertisfu albertisfu deleted the fix-edu-membership-payment-status branch April 10, 2026 18:13
@github-project-automation github-project-automation bot moved this from To Do to Done in Sprint (Web Team) Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants